<?php

// 支付回调
Route::post('registry_pay_notify', 'RegistryController@payNotify');

# 版权登记审核通知
Route::get('registry_audit_notify', 'RegistryController@notify');

Route::middleware([
    \App\Http\Middleware\AgentGateway::class,
    \App\Http\Middleware\ApiResponse::class,
])->group(function () {
    // 查询数据字典
    Route::get('registry/data/{key}', 'CommonController@getData');

    // 需要登录的接口
    Route::middleware(['auth:' . \App\Constant::GUARD_API])->group(function () {
        // 文件上传
        Route::post('registry/upload', 'CommonController@uploadFile');

        # 认证
        // 提交认证
        Route::post('registry/auths', 'AuthController@saveAuth');
        // 查询认证列表
        Route::get('registry/auths', 'AuthController@listAuths');
        // 查询认证详情
        Route::get('registry/auths/{id}', 'AuthController@getAuth');
        // 删除认证信息
        Route::delete('registry/auths/{id}', 'AuthController@deleteAuth');

        # 登记
        // 查询登记列表
        Route::get('registries', 'RegistryController@listRegistries');
        // 提交登记信息
        Route::post('registries', 'RegistryController@saveRegistry');
        // 查询登记详情
        Route::get('registries/{id}', 'RegistryController@getRegistry');
        // 获取登记支付参数
        Route::get('registries/{id}/payment_params', 'RegistryController@getPaymentParams');
        // 查询登记审核历史
        Route::get('registries/{id}/audit_histories', 'RegistryController@listAuditHistories');
    });
});
